package model

type User struct {
	Id   int
	Name string
}

//业务函数
func GetInfo(id int) *User {
	return &User{Id: id, Name: "wdc"}
}

type GetInfoFunc func(id int) *User

//装饰函数

func GetInfoWithRole(f GetInfoFunc) GetInfoFunc {
	return func(id int) *User {
		u := f(id)
		u.Name = "q_" + u.Name
		return u
	}
}
